const timeValue = 100;

function textAnimation() {
  var text = document.getElementById("error-text").innerHTML;
  var to = text.length;
  var textArea = document.getElementById("error-text");
  var i = 0;
  function animateText() {
    if (i <= to) {
      textArea.innerHTML = text.slice(0, i) + "|";
      i++;
      setTimeout(animateText, timeValue);
    }
  }
  animateText();
}

function error() {
	var errorText = document.getElementById("error-title").innerHTML;
	function replaceFake() {
		var replaceText = document.getElementById("error-title").innerHTML = "Okey, this is not Error ^^";	
	}
	function returnOriginal() {
		var returnText = document.getElementById("error-title").innerHTML = "ERROR!504";
	}
	setTimeout(replaceFake, 2500);
	setTimeout(returnOriginal, 5000);
}

// Thanks to AI for some helping me write this code!
// 
// However, I wrote the CSS and HTML myself. So apparently 
// I still need to learn and learn Js!
